import { combineReducers } from "redux";
import * as actionType from './action-type'
import {  reducer as homeReducer  } from '../view/Home/store'
/**
 * 还可以引入其他的reducer函数，从而合并成单一的reducer树
 */
const defalutState ={
    index:'/'
}
const appReducer = (state=defalutState,action:any)=>{
    switch(action.type){
        case actionType.SET_INDEX :
            return {...state,index:action.data}
        default:
            return state
    }
}
export default combineReducers({
    app:appReducer,
    home:homeReducer
}
)